VERSION 5.00
Begin VB.Form ReferredToForm 
   BackColor       =   &H00FFFFFF&
   BorderStyle     =   0  'None
   Caption         =   "Form1"
   ClientHeight    =   9000
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   12000
   LinkTopic       =   "Form1"
   ScaleHeight     =   9000
   ScaleWidth      =   12000
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   WindowState     =   2  'Maximized
   Begin VB.CommandButton Back_Button 
      Caption         =   "Back"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9600
      TabIndex        =   5
      Top             =   7560
      Width           =   1935
   End
   Begin VCT.ClientPlanCtrl PLAN 
      Height          =   3855
      Left            =   300
      TabIndex        =   3
      Top             =   180
      Width           =   11415
      _ExtentX        =   20135
      _ExtentY        =   6800
   End
   Begin VB.CommandButton Clear_Button 
      Caption         =   "Clear"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9600
      TabIndex        =   2
      Top             =   5520
      Width           =   1935
   End
   Begin VB.CommandButton Next_Button 
      BackColor       =   &H00C0FFFF&
      Caption         =   "Next"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9600
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   4500
      Width           =   1935
   End
   Begin VB.CommandButton Cancel_Button 
      BackColor       =   &H008080FF&
      Caption         =   "Cancel"
      BeginProperty Font 
         Name            =   "Arial Narrow"
         Size            =   20.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   9600
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   6540
      Width           =   1935
   End
   Begin VCT.TouchScreenListBox LB 
      Height          =   4575
      Left            =   840
      TabIndex        =   4
      Top             =   4140
      Width           =   8415
      _ExtentX        =   14843
      _ExtentY        =   8070
   End
End
Attribute VB_Name = "ReferredToForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'REFTO0 ... - Client Referred to
'Back to RRPLAN0 ...

Private Sub Back_Button_Click()
   RRPLAN0 = "1"
   RRPLAN1 = "0"
   RRPLAN2 = "0"
   RRPLAN3 = "0"
   RRPLAN4 = "0"
   RRPLAN5 = "0"
   RRPLAN6 = "0"
   RRPLAN7 = "0"
   RRPLAN8 = "0"
   RRPLAN9 = "0"
   RRPLAN10 = "0"
   RRPLAN11 = "0"
   RRPLAN12 = "0"
   RRPLAN99 = "0"
   REFTO0 = "1"
   REFTO1 = "0"
   REFTO2 = "0"
   REFTO3 = "0"
   REFTO4 = "0"
   REFTO5 = "0"
   REFTO6 = "0"
   REFTO7 = "0"
   REFTO8 = "0"
   REFTO8 = "0"
   REFTO9 = "0"
   REFTO10 = "0"
   REFTO11 = "0"
   RiskReductForm.Show
   Unload Me
End Sub

Private Sub Cancel_Button_Click()
   VCTStageForm.Show
   Unload Me
End Sub

Private Sub Clear_Button_Click()
   LB.Enabled = True
   LB.DeleteList
   REFTO0 = "1"
   REFTO1 = "0"
   REFTO2 = "0"
   REFTO3 = "0"
   REFTO4 = "0"
   REFTO5 = "0"
   REFTO6 = "0"
   REFTO7 = "0"
   REFTO8 = "0"
   REFTO9 = "0"
   REFTO10 = "0"
   REFTO11 = "0"
   REFTO99 = "0"
   LB.Enabled = True
   Form_Load
   
End Sub

Private Sub Form_Load()
   Next_Button.Enabled = False
   Clear_Button.Enabled = False
   PLAN.UpdateData
   PLAN.SetStar (3)
   
   If ORGANIZATION = "MACRO" Then
      LB.AddItem "Not referred"
      LB.AddItem "PLWA Assn (NAPHAM)"
      LB.AddItem "Hospital/Clinic"
      LB.AddItem "Post Test Club"
      LB.AddItem "Home Based Care"
      LB.AddItem "FP Clinic (BLM)"
      LB.AddItem "TB Clinic"
      LB.AddItem "MACRO Clinic"
      LB.AddItem "PMTCT Center"
     ' LB.AddItem "N/A"
      LB.AddItem "Other"
   Else
      If ORGANIZATION = "LIGHTHOUSE" Then
         LB.AddItem "Not referred"           '0
         LB.AddItem "PLWA Assn (NAPHAM)"     '1
         LB.AddItem "Post Test Club"         '2
         LB.AddItem "Home Based Care"        '3
         LB.AddItem "FP Clinic (BLM)"        '4
         LB.AddItem "TB Clinic"              '5
         LB.AddItem "PMTCT Center"           '6
         LB.AddItem "Lighthouse ARV Clinic"  '7
         LB.AddItem "STI Clinic"             '8
         LB.AddItem "Hospital/Clinic (NOS)"  '9
         LB.AddItem "Other"                  '10
      End If
   End If
   
End Sub

Private Sub LB_click()
   If ORGANIZATION = "MACRO" Then
      Select Case LB.ListIndex
         Case 0
            REFTO0 = "0"
            REFTO1 = "0"
            REFTO2 = "0"
            REFTO3 = "0"
            REFTO4 = "0"
            REFTO5 = "0"
            REFTO6 = "0"
            REFTO7 = "0"
            REFTO8 = "0"
            REFTO99 = "0"
            LB.Enabled = False
         Case 1
            REFTO1 = "1"
         Case 2
            REFTO2 = "1"
         Case 3
            REFTO3 = "1"
         Case 4
            REFTO4 = "1"
         Case 5
            REFTO5 = "1"
         Case 6
            REFTO6 = "1"
         Case 7
            REFTO7 = "1"
         Case 8
            REFTO8 = "1"
         Case 9
            REFTO99 = "1"
      End Select
   Else
      If ORGANIZATION = "LIGHTHOUSE" Then
         Select Case LB.ListIndex
            Case 0
               REFTO0 = "0"
               REFTO1 = "0"
               REFTO2 = "0"
               REFTO3 = "0"
               REFTO4 = "0"
               REFTO5 = "0"
               REFTO6 = "0"
               REFTO7 = "0"
               REFTO8 = "0"
               REFTO9 = "0"
               REFTO10 = "0"
               REFTO11 = "0"
               REFTO99 = "0"
               LB.Enabled = False
            Case 1
               REFTO1 = "1"
            Case 2
               REFTO3 = "1"
            Case 3
               REFTO4 = "1"
            Case 4
               REFTO5 = "1"
            Case 5
               REFTO6 = "1"
            Case 6
               REFTO8 = "1"
            Case 7
               REFTO9 = "1"
            Case 8
               REFTO10 = "1"
            Case 9
               REFTO11 = "1"
            Case 10
               REFTO99 = "1"
         End Select
      End If
   End If
   PLAN.UpdateData
   Next_Button.Enabled = True
   Clear_Button.Enabled = True
End Sub

Private Sub Next_Button_Click()
   'set REFTO0 to 1 if any rerefal otherwise set to zero (counter intuitive!)
   If REFTO1 = "1" Or REFTO2 = "1" Or REFTO3 = "1" Or REFTO4 = "1" Or REFTO5 = "1" Or REFTO6 = "1" Or REFTO7 = "1" Or REFTO8 = "1" Or REFTO9 = "1" Or REFTO10 = "1" Or REFTO11 = "1" Or REFTO99 = "1" Then
      REFTO0 = "1"
   Else
      REFTO0 = "0"
   End If

   CounseledForm.Show
   Unload Me
End Sub
